package a08threadmethod5;

import a04threadmethod.MyThread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-04-16
 * Time: 23:29
 */
public class ThreadDemo {
    public static void main(String[] args) throws InterruptedException {
        /*public final void join() 插入线程*/

        MyThread t = new MyThread();
        t.setName("土豆");
        t.start();

        //表示t这个线程插入到当前线程之前 (当前线程:main线程)
        t.join();


        //执行在main线程中的
        for (int i = 0; i < 10; i++) {
            System.out.println("main线程"+ i);
        }
    }
}
